
#include "key.h"
#include "usr_input_msg_handle.h"

/*@TODO: You have to finish below codes which depend on your software requirement*/

static INPUT_MSG_TASK_T input_msg_tsk = {0};

static void app_input_msg_tsk_handle(mo_task tsk, mo_msg_id id, mo_msg msg) {
  switch (id) {
    case SYS_KEY_EVENT: {
      mo_key_event_msg_t *key_msg = (mo_key_event_msg_t *)msg;
      if (key_msg != NULL) {
        mo_printf("--vk_code:%d, vk_patt:%d, click_num:%d-\r\n", key_msg->vk_code,key_msg->vk_patt, key_msg->click_num);
        switch(key_msg->vk_code){
          case HW_VOL_UP:
            break;
          case HW_VOL_DOWN:
            break;
          case HW_PW:
            break;
          case HW_BT:
            break;
          default:
            break;
        }
      }
    }
    break;

    case USR_EVENT_VOL_UP_HOLD:
        break;
    case USR_EVENT_VOL_DW_HOLD:
        break;
    default:
      break;
  }
}

void input_msg_tsk_init(void) { 

  memset(&input_msg_tsk,0,sizeof(input_msg_tsk));
  input_msg_tsk.tsk.handler = app_input_msg_tsk_handle;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  

}

const mo_task get_input_msg_tsk(void) { return &input_msg_tsk.tsk; }
